package javass;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;

public class Test {
	public static void main(String[] args) throws ClassNotFoundException, SQLException {
		/*Userinfo ui=new Userinfo();
		ui.setUsername("dsfsfsfds");
		ui.setPassword("123456");
		ui.setEmail("569972328@qq.com");
		ConnectionUtil connutil=new ConnectionUtil();
		Connection conn=connutil.getConn();
		PreparedStatementUtil psu=new PreparedStatementUtil();
		ResultSetUtil rsu=new ResultSetUtil();
		String sql=" SELECT u.`password`FROM userinfo u WHERE u.username=?;";
		PreparedStatement ps=psu.getPreparedStatement(conn, sql);
		ps.setString(1,ui.getUsername());
		ResultSet rs=rsu.getResultSet(ps);
		if(rs.next()){
			System.out.println(rs.getString(1));
			System.out.println(ui.getPassword());
			if (rs.getString(1).equals(ui.getPassword())) {
				System.out.println("登录");
			};
		}
		conn.close();
		ps.close();
		//rs.close();//有返回值时，比如select时才有结果集，才需要关闭
*/
		Userinfo ui=new Userinfo();
		ui.setUsername("dsfsfsfds");
		ui.setPassword("123456");
		Fangfa f=new Fangfa();
		System.out.println(f.login(ui));
	}
}
